package test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.DrawControl;

import android.graphics.Canvas;

import java.util.List;

import test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.model.CirclePointModel;


/**
 * Created by qinghua on 2015/8/25.
 */
public class CirclePointControl extends DrawControl {
    private List<CirclePointModel> circlePointModelList;
    private CirclePointModel circlePointModel;
    public CirclePointControl(Canvas canvas, List<CirclePointModel> circlePointModelList) {
        super(canvas);
        this.circlePointModelList = circlePointModelList;
    }
    public CirclePointControl(Canvas canvas, CirclePointModel circlePointModel) {
        super(canvas);
        this.circlePointModel = circlePointModel;
    }

    @Override
    public void beginDraw() {
        if (circlePointModelList != null && circlePointModelList.size() > 0) {
            for (CirclePointModel circlePointModel : circlePointModelList) {
                drawContent(circlePointModel);
            }
        } else {
            drawContent(circlePointModel);
        }
    }

    private void drawContent(CirclePointModel circlePointModel) {
        paint.setColor(circlePointModel.getBigCricleColor());
        mCanvas.drawCircle(circlePointModel.getCx(), circlePointModel.getCy(), circlePointModel.getBigCricleRadius(), paint);
        paint.setColor(circlePointModel.getSmallCricleColor());
        mCanvas.drawCircle(circlePointModel.getCx(),circlePointModel.getCy(),circlePointModel.getSmallCricleRadius(),paint);
    }
}
